﻿<!DOCTYPE html>
<html>
<body>

    <div id="showTimeZone"></div>
    <a><i class="lnr lnr-clock"></i> <span id="navbar_time"> </span></a>
    <script type="text/javascript">
    var nowTime = new Date();
        var timeZone = (0 - new Date().getTimezoneOffset() / 60);
        var showTimeZone = "课程：Web技术应用\n人工智能必修专业课程" ;
    document.getElementById("showTimeZone").innerText = showTimeZone;

    yy={{year}};
    mo={{month}};
    dd={{day}};
    hh={{hour}} + timeZone;
    mm={{min}};
    ss={{sec}};

    function fix(num, length) {
    return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
    }

    setInterval(function(){
                document.getElementById("navbar_time").innerText = "当前时间: "+yy+"/"+fix(mo,2)+"/"+fix(dd,2)+"/"+
                "   "+fix(hh,2)+":"+fix(mm,2)+":"+fix(ss,2);
                ss++;
                if(ss == 60){
                    ss=0;
                    mm++;
                    if(mm == 60){
                        mm=0;
                        hh++;
                        if(hh == 24){
                            hh == 0;
                        }
                    }
                }
    },1000);

    </script>


</body>
</html>